package org.study.plus.boot.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.*;

/**
 * 作用描述
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2025年08月18日
 */
public interface NoEntityMapper extends BaseMapper<Object> {
    Page<Map<String, Object>> dynamicPageQuery(IPage<Map<String, Object>> page,
                                               @Param("selectCols") String selectCols,
                                               @Param("tableName") String tableName,
                                               @Param(Constants.WRAPPER) Wrapper<Object> wrapper);

    Page<Map<String, Object>> dynamicQuerySql(IPage<Map<String, Object>> page, @Param("sql") String sql);

    @Select("${sql}")
    Page<Map<String, Object>> dynamicQueryAnnotation(IPage<Map<String, Object>> page, @Param("sql") String sql);

    Long doCount(@Param("sql") String sql);

    List<LinkedHashMap<String, Object>> doQuery(@Param("sql") String sql);
}
